package com.uchengwang.ui.cm_ui.cycle.viewHolder;

import android.view.View;
import android.view.ViewStub;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.uchengwang.R;

/**
 * Created by suneee on 2016/8/16.
 */
public class URLViewHolder extends CircleViewHolder{
    public LinearLayout urlBody;
    /** 链接的图片 */
    public ImageView url_cover;
    /** 链接的标题 */
    public TextView url_title;

    public URLViewHolder(View itemView){
        super(itemView, TYPE_URL);
    }

    @Override
    public void initSubView(int viewType, ViewStub viewStub) {
        if(viewStub == null){
            throw new IllegalArgumentException("viewStub is null...");
        }

        viewStub.setLayoutResource(R.layout.viewstub_urlbody);
        View subViw  = viewStub.inflate();
        LinearLayout urlBodyView =  subViw.findViewById(R.id.url_ln);
        if(urlBodyView != null){
            urlBody = urlBodyView;
            url_cover =  subViw.findViewById(R.id.url_cover);
            url_title =  subViw.findViewById(R.id.url_title);
        }
    }
}
